﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Model.Interfaces;
using Model.ModelClasses;
using Model.NotifyingCollections;
namespace View.Schools
{
    /// <summary>
    /// Interaction logic for MainSchoolsPanel.xaml
    /// </summary>
    public partial class MainSchoolsPanel : UserControl
    {
        public event EventHandler AddNewSchoolEvent;
        public event EventHandler RemoveSchoolEvent;
        private Model.ModelClasses.School currentSchool;
        private System.Collections.Generic.Dictionary<School, bool> selectedSchools;

        public MainSchoolsPanel()
        {
            InitializeComponent();
            selectedSchools = new Dictionary<School, bool>();
            SchoolsDataGrid.ItemsSource = Data.DataDispatcher.GetInstance().Schools;
        }

        private void addNewSchoolButtonClick(object sender, RoutedEventArgs e)
        {
            if (AddNewSchoolEvent != null) AddNewSchoolEvent(this, new EventArgs());
        }

        private void SchoolsDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if(SchoolsDataGrid.SelectedIndex != -1)
            {
                currentSchool = (School)SchoolsDataGrid.CurrentItem;
            }
        }

        private void SendMailButton_Click(object sender, RoutedEventArgs e)
        {
            foreach (School s in SchoolsDataGrid.SelectedItems)
            {

            }
        }

    }
}
